#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

const int N = 1e5 + 10;
int a[N], c[N], b;
int la, lc;

void sub(int* c, int* a, int b)
{
	long long t = 0;
	for (int i = lc - 1; i >= 0; i--)
	{
		t = t * 10 + a[i];
		c[i] = t / b;
		t %= b;
	}
	while (lc > 1 && !c[lc - 1]) lc--;
}
int main()
{
	string x; cin >> x >> b;
	la = x.size(); lc = la;
	for (int i = 0; i < la; i++) a[la - 1 - i] = x[i] - '0';
	sub(c, a, b);
	for (int i = lc - 1; i >= 0; i--) cout << c[i];
	return 0;
}